package com.hyjx.framework.common;

import com.hyjx.framework.common.util.SpringBeanUtil;
import com.hyjx.framework.orm.dao.IBaseDao;
import com.hyjx.framework.service.ConfigManager;
import com.hyjx.framework.uc.depart.DepartModel;

/**
 * 系统常量类
 *
 * @author dijian
 */
public class Constants {
    static {
        IBaseDao baseDao = (IBaseDao) SpringBeanUtil.getBean("baseDao");
        orgRootCode = (String) baseDao.queryObject(new DepartModel().getModuleName() + ".getRootCode", null);
    }
    
    public static final int PrimaryKeyLength = 15;
    public static final int ERROR_NUM = -9999;
    public static final int USER_MANAGER_DUTY = 19;
    public static final int ROLE_MANAGER_DUTY = 1;
    public static final String USER_ID = "_USER_ID_";
    public static final String USER_ACCOUNT = "_USER_ACCOUNT_";
    public static final String USER_NAME = "_USER_NAME_";
    public static final String DEPARTMENT_CODE = "_DEPARTMENT_CODE_";
    public static final String DEPARTMENT_NAME = "_DEPARTMENT_NAME_";
    public static final String USERINFO = "_USERINFO_";
    public static final String SUCCESS = "success";
    public static final String NONE = "none";
    public static final String ERROR = "error";
    public static final String INPUT = "input";
    public static final String LOGIN = "login";
    public static final String FAILURE = "failure";
    public static final String INDEX = "index";
    public static final String LIST = "list";
    public static final String VIEW = "view";
    public static final String EDIT = "edit";
    public static final String ADD = "add";
    public static final int PageSize = 10;
    public static final int PageNo = 1;
    public static final String SortCol = "";
    public static final String Order = "ASC";
    
    public static final String orgRootCode;    //根单位的code
    public static final String JSESSIONID = "JSESSIONID";
    public static final String JSESSIONID_WEBLOGIC = "jsessionid-core";
    
    public static final String VALIDATIONCODE = "validationCode";
    
    public static final String LOGIN_SERVICE_NAME = ConfigManager.getConfig("hyjx.service.login", "loginService");
    
    public static final String UPLOAD_SERVICE_NAME = ConfigManager.getConfig("hyjx.service.upload", "uploadService");
    
    public static final String DEPART_SERVICE_NAME = "departServiceImpl";
}